package com.knightboy.smartshoes.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.knightboy.smartshoes.R;
import com.knightboy.smartshoes.core.LisStepUtil;

/**
 * Created by 29288 on 2015/9/22.
 */
public class TestActivity extends Activity implements View.OnClickListener {
    TextView current_tv;
    EditText tobe_et;
    Button set_bt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        current_tv = (TextView)findViewById(R.id.current);
        tobe_et = (EditText)findViewById(R.id.tobe);
        set_bt = (Button)findViewById(R.id.set);

        current_tv.setText(LisStepUtil.getLimit() + "");
    }

    @Override
    public void onClick(View v) {
        if(v.getId() == R.id.set){
            String newNum = tobe_et.getText().toString();
            if(newNum.length() == 0){
                return;
            }
            double data = Double.parseDouble(newNum);
            LisStepUtil.setLimit(data);
        }
    }
}
